#ifndef _H_Aes_h_
#define _H_Aes_h_
#include <openssl/evp.h>
#include <openssl/aes.h>
#include <stdio.h>
#include <stdlib.h>

struct Aes
{
	EVP_CIPHER_CTX m_en;
	EVP_CIPHER_CTX m_de;
	unsigned char *m_salt;
};

int aes_init(unsigned char *key_data, int key_data_len, unsigned char *salt, EVP_CIPHER_CTX *e_ctx,EVP_CIPHER_CTX *d_ctx);

unsigned char *aes_encrypt(EVP_CIPHER_CTX *e, unsigned char *plaintext, int *len);

unsigned char *aes_decrypt(EVP_CIPHER_CTX *e, unsigned char *ciphertext, int *len);

int Aes_Aes(struct Aes* aes);

unsigned char * Aes_Encrypt(struct Aes* aes,unsigned char *plaintext, int *len);

unsigned char * Aes_Decrypt(struct Aes* aes,unsigned char *ciphertext, int *len);

int Aes_Init(struct Aes* aes,unsigned char *key_data, int key_data_len);


#endif


